{
  let myFavoriteNumber: string | number;
  myFavoriteNumber = "seven";
  console.log(myFavoriteNumber.length);
  myFavoriteNumber = 7;
  // console.log(myFavoriteNumber.length)
  // myFavoriteNumber = true;

  // access shared methods of union type
  function getLength(something: string | number): string {
    return something.toString();
  }
}
